package cn.roadtrip.mtravelbusinessmodule;

import cn.roadtrip.mtravelbusinessmodule.dao.basic.BasicMapper;
import cn.roadtrip.mtravelbusinessmodule.dao.basic.vpo.SysCategoryItem;
import cn.roadtrip.umysqlmodule.transaction.TransactionRollback;
import cn.roadtrip.utilmodule.util.DataBean;
import jakarta.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;

@Component
@Slf4j
public class TestRun {


    @Autowired
    private SqlSessionFactory sqlSessionFactory;
    @Autowired
    private TransactionRollback transactionRollback;

//    @PostConstruct
    public void runT() {
        try (SqlSession sql = sqlSessionFactory.openSession(true)) {
            BasicMapper mapper = sql.getMapper(BasicMapper.class);
            java.util.List<SysCategoryItem> cityList = mapper.queryCityCodeList("A02");
            log.info("cityList:{}", cityList);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
